<template>
  <view class="main-pd u-p-t-28">
    <view v-if="dataList.length && !loading">
      <view class="u-card u-m-b-20" v-for="item in dataList" :key="item.id">
        <view class="u-flex u-flex-between">
          <view class="u-flex u-flex-items-center">
            <view class="font-32 fw-600">{{ item.cyName }}</view>
            <view class="u-m-l-12"
              ><u-image
                :src="item.sex == '女' ? icon1 : icon2"
                width="32rpx"
                height="32rpx"></u-image
            ></view>
          </view>
          <view>{{ item.phone }}</view>
        </view>
      </view>
    </view>
    <view class="u-m-30" v-show="loading">
      <u-skeleton rows="5" title loading></u-skeleton>
    </view>
    <view class="empty-con">
      <u-empty mode="list" :show="!dataList.length && !loading"></u-empty>
    </view>
  </view>
</template>

<script setup>
import { getDzbcylistApi } from "@/api/index";
import { onLoad } from "@dcloudio/uni-app";
import { useList } from "@/hooks/useList";
import icon1 from "../../static/images/icon18.png";
import icon2 from "@/static/images/icon17.png";
import { ref } from "vue";
let wyId = ref("");
const { loadData, dataList, page, loading } = useList({
  listApi: getDzbcylistApi,
  otherParam: { param: JSON.stringify({ wyId: wyId.value }) },
});
onLoad((param) => {
  wyId.value = param.id;
  page.value = 1;
  dataList.value = [];
  loadData({ param: JSON.stringify({ wyId: wyId.value }) });
});
</script>

<style lang="scss" scoped></style>
